// io.h
// Joseph Craig, Rebecca Rush, Steven Andryzcik
// Version 6 - 12/08/2011

#ifndef IO_H
#define IO_H

#include "mpx_supt.h"
#include "process.h"
#include "device.h"
#include "TRMDRIVE.H"
#include <dos.h>
#include <stdlib.h>

#define PORT_QUEUE 10000
#define TERMINAL_QUEUE 20000

/******************** IO Request Descriptors Control Block ********************/
struct io_request_descriptors {
	char pcbName[PCB_NAME_SIZE];
	ppcb mypcb;
	int request_type; //refers to the op_code in params
	char *buffer_location; //refers to buf_addr in params
	int *count_buffer; //refers to count_addr in params
	unsigned long added;
};

typedef struct io_request_descriptors iod;
typedef struct io_request_descriptors *piod;

/****************************** IO Control Block ******************************/
struct io_control_block {
	int  event_flag;
	piod current;
};

typedef struct io_control_block iocb;
typedef struct io_control_block *piocb;

/********************************* Prototypes *********************************/
int empty_io(int *); 
int initialize_io(int *);
int io_scheduler();
void prime_request(int);

#endif

